package s13.ch15.ex2;

import java.util.ArrayList;
import java.util.Collection;

import s13.ch15.ex2.model.Car;

public class MyCollections1 {

	public static void main(String[] args) {
		Collection<Car> cars = new ArrayList();
		Car car1 = new Car();
		cars.add(car1);
		Car car2 = new Car();
		cars.add(car2);
		System.out.println(car1);
		for (Car car : cars) {
			System.out.println(car);
		}
		System.out.println(cars.size()); // ctrl+alt+arrow copy line
		
		cars.remove(car1);
		for (Car car : cars) {
			System.out.println(car);
		}
		System.out.println(cars.size());
		System.out.println(cars.contains(car2));
		System.out.println(cars.contains(car1));
		System.out.println(cars.isEmpty());
		cars.remove(car2);
		System.out.println(cars.isEmpty());
		
		
	}

}
